package com.example.demo.mapper;

import com.example.demo.entity.GenealogyPerson;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface GenealogyPersonMapper {
    List<GenealogyPerson> selectAll();

    @Select("SELECT * FROM `genealogy_person` WHERE person_id = #{personId}")
    GenealogyPerson selectById(Long personId);

    void insert(GenealogyPerson person);

    void updateById(GenealogyPerson person);

    @Delete("DELETE FROM `genealogy_person` WHERE person_id = #{personId}")
    void deleteById(Long personId);

    @Select("SELECT * FROM `genealogy_person` WHERE genealogy_id = #{genealogyId}")
    List<GenealogyPerson> selectByGenealogyId(Long genealogyId);
}